package com.jndi;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import javax.naming.InitialContext;
import javax.naming.NamingException;

@Slf4j
@Data
public class JndiDemo {
    public static void main(String[] args) {
        try {
            InitialContext ctx = new InitialContext();
            Object lookup = ctx.lookup("java:testdata");
            System.out.println(lookup);
        } catch (NamingException e) {
            e.printStackTrace();
        }

    }
}
